package com.company.fcade;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class FileReader {
    public String read(String fileNameString){
        System.out.println("读取文件，获取明文");
        StringBuffer sb=new StringBuffer();
        try {
            FileInputStream inFS=new FileInputStream(fileNameString);
            int data;
            while((data=inFS.read())!=-1){
                sb=sb.append(data);
            }
            inFS.close();
            System.out.println(sb.toString());
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return sb.toString();
    }
}
